Path: blob/master/src/packages/next/pages/[owner]/[project]/[...public_path].tsx
1451 views
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45// Page for a project that is owned by a named account6// or organization.78import getPublicPathId from "lib/names/public-path";9import getPublicPathInfo from "lib/share/get-public-path-info";10import withCustomize from "lib/with-customize";11import PublicPath from "components/path/path";1213export default PublicPath;1415export async function getServerSideProps(context) {16const { owner, project, public_path } = context.params;17try {18const id = await getPublicPathId(owner, project, public_path);19const props = await getPublicPathInfo({20id,21public_path,22req: context.req,23});24return await withCustomize({ context, props });25} catch (_err) {26return { notFound: true };27}28}293031